package com.team.arms.service_management_before.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.team.arms.service_management_before.domain.ClothingTable;
import com.team.arms.service_management_before.domain.dto.ClothingTableDto;
import com.team.arms.service_management_before.domain.vo.ClothingTableVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Entity com.team.arms.service_management_before.domain.ClothingTable
 */
public interface ClothingTableMapper extends BaseMapper<ClothingTable> {

    @Select("SELECT y.clothing_id,b.name,y.batch_id,y.clothing_size,y.shoe_size\n" +
            "FROM y_clothing_table as y,b_bingyi_info as b\n" +
            "WHERE y.bingyi_id = b.bingyi_info_id")
    List<ClothingTableVo> selectList();

    int insertAll(ClothingTable clothingTable);

    @Select("SELECT y.clothing_id,b.name,y.batch_id,y.clothing_size,y.shoe_size\n" +
            "FROM y_clothing_table as y,b_bingyi_info as b\n" +
            "WHERE y.bingyi_id = b.bingyi_info_id\n" +
            "AND y.clothing_id = ${clothingId}")
    ClothingTableVo selectListById(@Param("clothingId") String id);

    List<ClothingTableVo> selectClothingTable(ClothingTableDto clothingTableDto);

    @Select("SELECT y.clothing_id,b.name,y.batch_id,y.clothing_size,y.shoe_size\n" +
            "FROM y_clothing_table as y,b_bingyi_info as b\n" +
            "WHERE y.bingyi_id = b.bingyi_info_id\n" +
            "AND ${field} like \"%${content}%\"")
    List<ClothingTableVo> selectByFiled(@Param("field") String field, @Param("content") String content);
}




